namespace RAG.Domain.Entities.App;

/// <summary>
/// 知识库实体 - 用于存储文本和图片的向量化数据
/// </summary>
public class KnowledgeBase : EntityBase
{
    /// <summary>
    /// 向量嵌入数据 (1024维)
    /// </summary>
    public float[] Embedding { get; set; } = default!;

    /// <summary>
    /// 关联的文档块ID
    /// </summary>
    public Guid ChunkId { get; set; }

    /// <summary>
    /// 内容文本 - 原始文本内容或图片描述
    /// </summary>
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 文档类型 (text/image/pdf/docx等)
    /// </summary>
    public string DocumentType { get; set; } = string.Empty;

    /// <summary>
    /// 嵌入类型 (text-embedding/multimodal-embedding)
    /// </summary>
    public string EmbeddingType { get; set; } = string.Empty;

    /// <summary>
    /// 图片URL (仅图片类型使用)
    /// </summary>
    public string? ImageUrl { get; set; }

    /// <summary>
    /// 是否已分块处理
    /// </summary>
    public bool IsChunked { get; set; } = false;

    /// <summary>
    /// 元数据 (JSON格式存储额外信息)
    /// </summary>
    public string? Metadata { get; set; }

    /// <summary>
    /// 数据源 (file/url/manual等)
    /// </summary>
    public string? Source { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 导航属性 - 关联的文档块
    /// </summary>
    public DocumentChunks? Chunk { get; set; }
}
